﻿/************************************************************************

	File:			args_cross.h
	Version:		1.0
	Changes:		A
	Author:			Stanley Lau
	Date:			2010.07.30
	Purpose:		Arguments process functions cross-plat declaration

************************************************************************/

#ifndef _ARGS_CROSS_H_
#define _ARGS_CROSS_H_



#define ARGS_PLAT_WIN32 1
#define ARGS_PLAT_LINUX 2
#define ARGS_PLAT_UNIX 3
//默认平台标志宏
#ifndef ARGS_PLAT_FLAG
#define ARGS_PLAT_FLAG ARGS_PLAT_WIN32
#endif


#define ARGS_LIB_IMPORT 1
#define ARGS_LIB_EXPORT 2
#define ARGS_LIB_SRC	3
//默认库导入导出控制宏
#ifndef ARGS_LIB_CONTROL
#define ARGS_LIB_CONTROL ARGS_LIB_IMPORT
#endif


#define ARGS_FUNC_WIN32_IMPORT __declspec(dllimport)
#define ARGS_FUNC_WIN32_EXPORT __declspec(dllexport)
#define ARGS_FUNC_WIN32_SRC
#define ARGS_FUNC_LINUX_ALL
#define ARGS_FUNC_UNIX_ALL


#ifdef __cplusplus
#define ARGS_CPP extern "C"
#else
#define ARGS_CPP
#endif

//函数导入导出控制符配置
#if ARGS_PLAT_FLAG==ARGS_PLAT_WIN32
	#if ARGS_LIB_CONTROL==ARGS_LIB_IMPORT
		#define ARGS_FUNC_CONTROL ARGS_FUNC_WIN32_IMPORT
	#elif ARGS_LIB_CONTROL==ARGS_LIB_EXPORT
		#define ARGS_FUNC_CONTROL ARGS_FUNC_WIN32_EXPORT
	#elif ARGS_LIB_CONTROL==ARGS_LIB_SRC
		#define ARG_FUNC_CONTROL ARG_FUNC_WIN32_SRC
	#endif
#elif ARGS_PLAT_FLAG==ARGS_PLAT_LINUX
	#define ARGS_FUNC_CONTROL ARGS_FUNC_LINUX_ALL
#elif ARGS_PLAT_FLAG==ARGS_PLAT_UNIX
	#define ARGS_FUNC_CONTROL ARGS_FUNC_UNIX_ALL
#endif


//通用函数名宏
#ifdef _UNICODE
#define KArgs KArgs_w
#define PKArgs PKArgs_w
#define KArgItem KArgItem_w
#define PKArgItem PKArgItem_w
#define GetArgs GetArgs_w
#define ReleaseArgs ReleaseArgs_w
#define GetStringItem GetStringItem_w
#define GetIntItem GetIntItem_w
#define HasItem HasItem_w
#else
#define KArgs KArgs_a
#define PKArgs PKArgs_a
#define KArgItem KArgItem_a
#define PKArgItem PKArgItem_a
#define GetArgs GetArgs_a
#define ReleaseArgs ReleaseArgs_a
#define GetStringItem GetStringItem_a
#define GetIntItem GetIntItem_a
#define HasItem HasItem_a
#endif

#endif
//Last line for linux

